package com.stlm2.dems.sns.entity;

/**
 * 短信状态
 *
 */
public enum SmsState {
	Sended(1, "已发送"),
	Used(4, "已使用"),
	Expired(7, "已过期");

	private transient final int val;
	private transient final String desc;
	
	SmsState(int val, String desc){
		this.val = val;
		this.desc = desc;
	}
	
	public int getIntValue(){
		return val;
	}
	
	public String toString(){
		return desc;
	}
	
	public static SmsState getByIntValue(int v){
		switch(v){
			case 1:
				return Sended;
			case 4:
				return Used;
			case 7:
				return Expired;
			default:
				return null;
		}
	}
}
